Release 10.1A: OpenEdge Getting Started:
WebSpeed Essentials


SpeedScript and CGI wrappers

SpeedScript is an implementation of the Progress 4GL language that is primarily used to develop Web applications. Progress 4GL is inserted into HTML by using special HTML tags. When the WebSpeed compiler compiles this HTML, it converts it into a CGI wrapper automatically. You can also write CGI wrappers directly. SpeedScript includes a built-in Web server input/output (I/O) system that provides access to the CGI environment and Web page output stream for a Web request.

Note: SpeedScript supports extensions that allow the use of XML through SAX and the Document Object Model (DOM) interface. These extensions provide the basic input, output, and low-level data manipulation capabilities required to use data contained in XML documents. For more information about XML support, see OpenEdge Development: Programming Interfaces , which describes XML support in the context of the Progress 4GL. However, the information also applies to SpeedScript, which is based on the Progress 4GL.

See the following sources for more information regarding SpeedScript:

Similarities between the 4GL and SpeedScript

The similarities between the 4GL and SpeedScript include:

Differences between the 4GL and SpeedScript

Some important differences between SpeedScript programming and Progress 4GL programming are:

These examples also rely on SpeedScript preprocessor references, especially {&OUT} and {&DISPLAY}, to direct output to the WebSpeed-defined output stream, WebStream. You can find the definitions for these preprocessor references (and several others) in install-path/src/web/method/cgidefs.i. For more information on the {&DISPLAY} preprocessor reference, see OpenEdge Application Server: Developing WebSpeed Applications . For more information on the SpeedScript preprocessor and more advanced SpeedScript topics, see OpenEdge Development: Progress 4GL Handbook .

SpeedScript versus JavaScript

It is a common practice to use both SpeedScript and JavaScript when developing WebSpeed applications. SpeedScript has advantages for developing the business logic of applications, while JavaScript is a good programming tool for adding user interface elements to Web applications.

If you use either the Report or Detail templates in AppBuilder to create a WebSpeed Web object, you can view the resulting HTML source file and see a combination of SpeedScript and JavaScript. The templates will help you create SpeedScript to implement database queries and updates, and they will create JavaScript event handlers (like onMouseOver, onClick, etc.) to implement interactive features of the WebSpeed applications.

The <SCRIPT> tag for JavaScript employs the same syntax as the <SCRIPT> tag for Embedded SpeedScript, as shown:

<SCRIPT Language="JavaScript">
JavaScript Code
</SCRIPT> 

In some situations, you do not need a <SCRIPT> tag. JavaScript event handlers, for example, do not require a <SCRIPT> tag when they are used as an attribute to an HTML tag, as shown in the following example:

<BODY onLoad="alert(’Done’);"> 

Some other factors that you should keep in mind when using JavaScript in WebSpeed applications are:

Additional SpeedScript components

The WebSpeed development environment also contains the following components:


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095